.PHONY: all clean

TARGET=aec_demo wave_reader_unittest
SRC:=$(wildcard *.cc)
OBJ=$(patsubst %.cc, %.o, ${SRC})
EXE=$(patsubst %.cc, %, ${SRC})
DIR=$(shell pwd)

CC=gcc
CXX=g++
CXXFLAGS=-c -g -O0 -fPIC -I../
LDFLAGS=-L${DIR}/../out -Wl,--no-as-need -Wl,-rpath=${DIR}/../out -lwebrtc_aec3 -pthread -lm


all: ${TARGET}

wave_reader.o: wave_reader.cc
	${CXX} ${CXXFLAGS} wave_reader.cc 

aec_demo: aec_demo.cc wave_reader.o
	${CXX} ${CXXFLAGS} aec_demo.cc 
	${CXX} aec_demo.o wave_reader.o ${LDFLAGS} -o aec_demo

wave_reader_unittest: wave_reader.o wave_reader_unittest.cc
	${CXX} ${CXXFLAGS} wave_reader_unittest.cc 
	${CXX} wave_reader_unittest.o wave_reader.o ${LDFLAGS} -o wave_reader_unittest

clean:
	rm  -rf ${OBJ} ${EXE}

